package teacher;

import student.Student;

public class Teacher extends Student {
    private String subject;   // 教授学科

    public Teacher(String id, String name, String gender, int age, String subject) {
        // 调用父类的构造方法初始化公共字段
        super(id, name, gender, age, 0, null); // grade 和 teacherId 对教师无意义
        this.subject = subject;
    }

    // Getter 和 Setter
    public String getSubject() {
        return subject;
    }

    public void setSubject(String subject) {
        this.subject = subject;
    }

    @Override
    public String toString() {
        return "Teacher{" +
                "id='" + getId() + '\'' +
                ", name='" + getName() + '\'' +
                ", gender='" + getGender() + '\'' +
                ", age=" + getAge() +
                ", subject='" + subject + '\'' +
                '}';
    }
}
